package com.antoco.operation.bigscreen.controller.modelcontroller.intf;

import com.antoco.operation.bigscreen.commons.annotation.IsSensorExist;
import com.antoco.operation.bigscreen.model.dto.SensorDTO;
import com.antoco.operation.bigscreen.model.dto.SensorParamDTO;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Api(tags = "传感器 API")
public interface SensorController {
    @ApiOperation("插入单条记录")
    public SensorParamDTO save(@RequestBody SensorParamDTO sensor);

    // @ApiOperation("Find by Id")
    public SensorDTO findById(@PathVariable("id") Long id);

    // @ApiOperation("Delete based on primary key")
    public void delete(@PathVariable("id") Long id);

    @ApiOperation("查询全部记录")
    public List<SensorDTO> list();

    // @ApiOperation("Pagination request")
    public Page<SensorDTO> pageQuery(Pageable pageable);

    @ApiOperation("更新记录")
    public SensorDTO update(@RequestBody SensorParamDTO dto, @PathVariable("id") @IsSensorExist Long id);
}